<?php
// Header 
$this->left_menu = 'menu/'.$this->params['controller'];
$params = array(
	'root'	=>	$this->params['named']['root']
);
if (isset($this->params['plugin'])) {
	$params['plugin'] = $this->params['plugin'];
} else {
	$params['plugin'] = null;
}
// Load Css

// Load Javascript

?>

<?php echo $session->flash()?>

<div class='right_content'>
<?php 
$module_name = isset($category) ? $category['name'] : $configs['EditablePage']['global']['module_name'];
$plural = isset($category) ? $category['name'] : Inflector::pluralize($configs['EditablePage']['global']['module_name']);
?>
<div class="title_left_sidebar">
	<div class="text_title">
		<?php echo sprintf(__("Danh sách %s", true), $plural)?>
	</div>
	<div class="create_edit">
		<div class="bd_title"></div>
		<div class="item_create">
			<div class="item_menu"><?php echo $html->image('toolbar/add.png', array('alt'=>__('Tạo trang mới',true), 'align'=>'left')) ?></div>
			<div class="category_mn"><a href="<?php echo $html->url($params + array('action'=>'add'))?>" id='add_new_category_link'><?php echo sprintf(__("Tạo mới %s", true), $module_name)?></a></div>
			<div class="clear"></div>
		</div>
		<div class="bd_title"></div>
	</div>
	
</div>

<div class="blank5"></div>


<!-- Begin tree table -->
<div class='right_table'>
<table class= 'list form_background' cellspacing='1' cellpadding='0' id='room_type_list'>
	<tr>
		<th width='23'><a><?php echo __("#"); ?></a></th>
		<th><?php echo $paginator->sort(__("Tiêu đề", true), 'EditablePage.title'); ?></th>
		<th><?php echo $paginator->sort(__("Danh mục", true), 'Category.name'); ?></th>
		<th width='150'><a><?php echo __("Chức năng"); ?></a></th>
	</tr>
	<?php if(!$pages):?>
	<tr class="row1">
		<td colspan="4"><?php echo __("Chưa có dữ liệu.");?></td>
	</tr>
	<?php
	endif;
		$i=0;
		$class = 'altrow';
		$room_type_list = array();
		foreach ($pages as $page) {
			
			$class = $class == "" ? "class='altrow'" : "";
			$page_id = $page['EditablePage']['id'];
			//$class = "row".($i%2)?"0":"1";
			$i++;
	?>
	<tr <?php echo $class?> page_id="<?php echo $page_id?>">
		<td><?php echo $i?></td>
		<td>
			<span class='field_name'><?php echo $page['EditablePage']['title']?></span>
		</td>
		<td>
			<span class='field_category'><?php echo $page['Category']['name']?></span>
		</td>
		<td class='actions'>
			<div class="sub_menu_list">
				<div class="cssdropdown">
					<ul>
						<li class="headlink">
							<a href="#"><?php __("Chức năng")?></a>
							<ul rel='<?php echo $page_id?>'>
 							 <li><a class="list_03 edit_page_link" page_id="<?php echo $page_id?>" href="<?php echo $html->url($params + array('controller'=>$this->params['controller'], 'action'=>'edit', $page_id))?>"><?php __("Chỉnh sửa");?></a></li>
							 <li><a class="list_04 delete_page" href="<?php echo $html->url($params + array('controller'=>$this->params['controller'], 'action'=>'delete', $page_id))?>" onclick="return confirm('<?php __("Bạn có thật sự muốn xóa xóa trang này?")?>')"><?php __("Xóa");?></a></li>
							</ul>
						</li>
					</ul>
				</div>
			</div>
		</td>
	</tr>
	<?php }?>
</table>
</div>
<!-- End tree table -->

</div>